package com.example.websocketproject.util;

import lombok.Data;

/**
 * @author : Mr.Wang
 * @date : 2020-07-20 11:39
 **/
@Data
public class ResultView<T> {
    /**
     * request success or not, 0 is success 1 is error
     */
    private Integer status;
    /**
     * error code
     */
    private Integer code;
    /**
     * Error message
     */
    private String msg;
    /**
     * Returned data
     */
    private T data;

    private Object feature;

    public ResultView() {
        this.status = 0;
        this.code = 0;
    }

    public ResultView(Integer errCode, String msg) {
        this.code = errCode;
        this.msg = msg;
    }

    public ResultView(T data) {
        this.code = 0;
        this.data = data;
    }

    public ResultView(Integer code) {
        this.code = code;
    }

}
